package com.gx.common.enums;

import lombok.Getter;

/**
 * @Author Liu-pj
 * @Date 2022/2/22 14:32
 * 状态码
 **/
@Getter
public enum ResultCodeEnum {
    USER_ERROR(203, "当前用户不存在"),
    LOGIN_PASSWORD_ERROR(202, "密码错误"),
    PARAM_ERROR(101, "参数不正确"),
    PARAM_REQUIRE(103, "缺少参数"),
    PARAM_INVALID(102, "无效参数"),
    DATA_NOT_EXIST(104, "数据不存在"),
    DATA_IS_EXIST(105, "数据已存在"),
    UNKNOWN_REASON(500, "未知错误,请稍后重试"),
    UPDATE_ERROR(405, "修改失败"),
    SAVE_ERROR(406, "新增失败"),
    GET_ERROR(407, "查询失败"),
    DEL_ERROR(408, "删除失败"),
    //成功
    SUCCESS(200, "成功"),
    //FAIL(400, "失败"),//失败
    BAD_REQUEST(400, "Bad Request"),
    //未认证
    UNAUTHORIZED(401, "认证失败"),
    //未认证
    Z_WITHOUT_CODE_NOT_BINGD(4001, "该用户未绑定系统用户"),
    //接口不存在
    NOT_FOUND(404, "接口不存在"),
    //服务器内部错误
    INTERNAL_SERVER_ERROR(500, "系统繁忙"),
    METHOD_NOT_ALLOWED(405, "方法不被允许");

    private final Integer code;
    private final String message;

    ResultCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

}